﻿@using Utilities
@using Models;
@model StockChangeRecord
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">

</script>
@Html.ValidationSummary(true)
@using (Html.BeginForm())
{
    <fieldset>
        <legend>库存变化记录</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.StockChangeName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StockChangeName)
            @Html.ValidationMessageFor(model => model.StockChangeName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.StockChangeTypeID, "库存变化类型")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.StockChangeTypeID, new SelectList(CH.GetAllData<StockChangeType>().FindAll(s => s.Direction == "出库"), "ID", "StockChangeTypeName"), "-请选择-")
            @Html.ValidationMessageFor(model => model.StockChangeTypeID)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryID, "库存变化的库存品种类")
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Category.CategoryName)
             @Html.HiddenFor(model => model.CategoryID)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.QualityID, "库存变化的库存品质量")
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Quality.QualityName)
            @Html.HiddenFor(model => model.QualityID)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.AreaID, "所在单位")
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Area.AreaName)
            @Html.HiddenFor(model => model.AreaID)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.WarehouseID, "所在仓库")
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Warehouse.WarehouseName)
            @Html.HiddenFor(model => model.WarehouseID)
        </div>
        <div class="editor-label">
            @Html.Label("当前库存的数量")
        </div>
        <div class="editor-field">
            @Html.Label("mv", ViewBag.MaxVolume as string)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Volume)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Volume)
            @Html.ValidationMessageFor(model => model.Volume)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Sequence)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sequence)
            @Html.ValidationMessageFor(model => model.Sequence)
        </div>
        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("回到列表", "Index")
</div>
